package com.myxh.compiler;

/**
 * 错误信息实体类
 * @author MLD
 * @date 2015年12月27日
 */
public class ErrorInfo {
	public final static int REPEAT_DEFINE=0x1001;//重复定义
	public final static int VARIABLE_NAME_NOT_LEGAL = 0x1002;//变量名不合法
	private int code;//错误码
	private Word word;//错误单词
	private String message;//错误信息
	
	public ErrorInfo(int code, Word word, String message) {
		super();
		this.code = code;
		this.word = word;
		this.message = message;
	}
	
	public String toString()
	{
		String str = String.valueOf(code)+"\t"+word.wordStr+"\t"+ "lint:"+word.line +"\t\t"+message;
		return str;
	}
	
	public int getCode() {
		return code;
	}
	public void setCode(int code) {
		this.code = code;
	}

	public Word getWord() {
		return word;
	}
	public void setWord(Word word) {
		this.word = word;
	}
	public String getMessage() {
		return message;
	}
	public void setMessage(String message) {
		this.message = message;
	}

	
}
